home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_gen / t4diblib.zip / ANIMATE3.F4_ / ANIMATE3.F4
Text File  |  1995-12-11  |  3KB  |  111 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Appearance      =   0  'Flat
  4.    BackColor       =   &H80000005&
  5.    Caption         =   "ANIMATE3"
  6.    ClientHeight    =   1692
  7.    ClientLeft      =   2628
  8.    ClientTop       =   2688
  9.    ClientWidth     =   2772
  10.    BeginProperty Font 
  11.       name            =   "MS Sans Serif"
  12.       charset         =   1
  13.       weight          =   700
  14.       size            =   7.8
  15.       underline       =   0   'False
  16.       italic          =   0   'False
  17.       strikethrough   =   0   'False
  18.    EndProperty
  19.    ForeColor       =   &H80000008&
  20.    Height          =   2112
  21.    Left            =   2580
  22.    LinkTopic       =   "Form1"
  23.    ScaleHeight     =   1692
  24.    ScaleWidth      =   2772
  25.    Top             =   2316
  26.    Width           =   2868
  27.    Begin VBX.T4DILIB dilib1 
  28.       Caption         =   "dilib1"
  29.       ControlMode     =   0  'Lib -> PIC
  30.       Height          =   372
  31.       Left            =   1680
  32.       Top             =   1200
  33.       Visible         =   0   'False
  34.       Width           =   972
  35.    End
  36.    Begin VB.CommandButton Command1 
  37.       Appearance      =   0  'Flat
  38.       BackColor       =   &H80000005&
  39.       Caption         =   "&Quit"
  40.       Height          =   372
  41.       Left            =   120
  42.       TabIndex        =   0
  43.       Top             =   1200
  44.       Width           =   1452
  45.    End
  46.    Begin VB.Image Image1 
  47.       Appearance      =   0  'Flat
  48.       Height          =   372
  49.       Left            =   120
  50.       Stretch         =   -1  'True
  51.       Top             =   120
  52.       Width           =   972
  53.    End
  54. End
  55. Attribute VB_Name = "Form1"
  56. Attribute VB_Creatable = False
  57. Attribute VB_Exposed = False
  58. Option Explicit
  59. Private Declare Function GetFreeSpace& Lib "kernel" (ByVal x%)
  60. Dim TimeIn!
  61. Dim Frames%
  62.  
  63. Private Sub Command1_Click()
  64.  Terminate
  65. End Sub
  66.  
  67. Private Sub Form_Load()
  68. Dim loopctr%, memctr%
  69. Dim imwidth!, imheight!, imhwratio!
  70.  Top = (Screen.Height - Height) / 2!
  71.  Left = (Screen.Width - Width) / 2!
  72.  dilib1.LibraryName = "bluespin.ilb"
  73.  dilib1.Action = IM_ACTION_OPENLIBRARY
  74.  Show
  75.  Form1.Refresh
  76.  TimeIn = Timer
  77.  For loopctr = 1 To 100
  78.   For memctr = 1 To dilib1.MemberCount
  79.    dilib1.MemberNumber = memctr
  80. 'Keep Image1.Width constant.
  81. 'Calculate how high image1 should be.
  82.    imwidth = dilib1.PixelWidth
  83.    imheight = dilib1.PixelHeight
  84.    imhwratio = imheight / imwidth
  85.    image1.Height = imhwratio * image1.Width
  86.    dilib1.Action = IM_ACTION_GETMEMBER
  87.    image1.Picture = dilib1.Picture
  88.    image1.Refresh
  89.    Frames = Frames + 1
  90.   Next memctr
  91.   DoEvents
  92.  Next loopctr
  93.  Terminate
  94. End Sub
  95.  
  96. Private Sub Form_Unload(Cancel As Integer)
  97.  End
  98. End Sub
  99.  
  100. Private Sub Terminate()
  101. Dim TimeOut!, TimeElapsed!, fps!
  102.  TimeOut = Timer
  103.  TimeElapsed = TimeOut - TimeIn
  104.  fps = Frames
  105.  fps = Frames / TimeElapsed
  106.  MsgBox Trim$(Str$(fps)) + " frames per second."
  107.  End
  108. End Sub
  109.  
  110.  
  111.